<template>
  <m-page>
    <!-- 结清证明详情 -->
    <m-header title="结清证明详情"></m-header>
    <div class="settled_detail">
      <!-- 未结清，无可打印证明 -->
      <div v-if="!isSettled">
        <div class="g-null"></div>
        <div class="g-txt">
          <p>您该卡片下的透支卡尚未全部还清,</p>
          <br />
          <p>无法打印结清证明</p>
        </div>
      </div>

      <div v-if="isSettled&&isLoading" class="g-detail">
        <p>结清证明附件消息</p>
        <div class="u-btn1">
          <ynet-button @click="gotoSendMail">发送至邮箱</ynet-button>
        </div>
        <div class="u-btn2">
          <ynet-button type="warning" @click="showPopUp('center')">下载证明</ynet-button>
        </div>
        <ynet-popup v-model="isPopupShow.center">
          <div class="md-example-popup md-example-popup-center">下载成功，已为您保存到相册文件夹</div>
        </ynet-popup>
      </div>
    </div>
  </m-page>
</template>

<script>
import { Button, Popup } from "ynet-mobile";
export default {
  components: {
    [Button.name]: Button,
    [Popup.name]: Popup
  },
  data() {
    return {
      isSettled: true,
      isLoading: true,
      isPopupShow: {}
    };
  },
  methods: {
    // showLoading() {
    //   app.api.showLoading("正在为您生成结算证明", 3).then(res => {
    //     setTimeout(() => {
    //       this.isLoading = true;
    //       console.log(res);
    //     }, 3000);
    //   });
    // }
    goto(item,params){
      let url=`http://172.16.1.197:8080/smallbusinessloan/xin_yi_tong_card/${item}`;
      window.location.href=url;
    },
    showPopUp(type) {
      this.$set(this.isPopupShow, type, true);
    },
    hidePopUp(type) {
      this.$set(this.isPopupShow, type, false);
    },
    gotoSendMail(){
      this.goto("settled_send_mailbox.html")
    }
  },
  created() {
    // if (this.isSettled) {
    //   this.showLoading();
    // }
  },
  mounted() {},
  watch: {},
  computed: {}
};
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>

